{template header_client}
{template pm_nav}

<div class="ucinfo">
	<h1>$pms[0][subject]<span>
	<!--{if $pms[0][msgfromid] && $pms[0][msgtoid]}-->
		<button onclick="location.href='index.php?m=pm_client&a=delete&pmid=$pmid&folder=$folder&$extra'">{lang delete}</button>
		<button onclick="location.href='index.php?m=pm_client&a=send&pmid=$pmid&do=forward&$extra'">{lang pm_transmit}</button>
	<!--{/if}-->
	<!--{if $from == 'newbox'}-->
		<button onclick="location.href='index.php?m=pm_client&a=ls&folder=newbox&$extraret'">{lang return}</button>
	<!--{else}-->
		<button onclick="location.href='index.php?m=pm_client&a=ls&folder=$folder&filter=$filter&$extraret'">{lang return}</button>
	<!--{/if}-->
	</span></h1>

	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="newpm">
	<!--{loop $pms $pm}-->
		<tbody>
			<tr<!--{if $pm[new]}--> class="onset"<!--{/if}-->>
				<td class="sel"></td>
				<td class="ava"><!--{if $filter != 'announcepm'}--><img src="avatar.php?uid=$pm[msgfromid]&size=small" /><!--{/if}--></td>
				<td class="pef">
				<!--{if $pm[msgfromid]}-->$pm[msgfrom]<!--{else}-->{lang pm_system}<!--{/if}-->
				<p>$pm[dateline]</p>
				</td>
				<td class="title">$pm[message]</td>
			</tr>
		</tbody>
	<!--{/loop}-->

	<!--{if $pms[0][msgfromid] && $pms[0][msgtoid]}-->
		<form method="post" id="postpmform" name="postpmform" action="index.php?m=pm_client&a=send&pmid=$pmid&$extra">
		<input type="hidden" name="formhash" value="{FORMHASH}">
		<input type="hidden" name="saveoutbox" value="0" />
		<input type="hidden" name="folder" value="<!--{if $from}-->$from<!--{else}-->$folder<!--{/if}-->" />
		<input type="hidden" name="related" value="$pmid" />
		<input type="hidden" name="msgto" value="$msgto" />

		<tfoot>
		<tr>
			<td class="sel"></td>
			<td class="ava"></td>
			<td class="pef"></td>
			<td class="title">
				<strong>{lang reply}</strong>:
				{template pm_editorbar}
				<textarea class="listarea" id="pm_textarea" rows="6" cols="10" name="message" onKeyDown="ctlent(event)"></textarea>
				<p class="pages_btns"><button name="pmsubmit" class="pmsubmit" type="submit">{lang pm_sendpm}</button></p>
			</td>
		</tr>
		</tfoot>
		</form>
	<!--{/if}-->
</div>

<!--{if $scroll == 'bottom'}-->
	<script type="text/javascript">
	window.onload = function() {
		window.scroll(0, document.body.scrollHeight);
		document.postpmform.message.focus();
	}
	</script>
<!--{/if}-->

{template footer_client}